package ch.fhnw.kosmonauten.net;

import java.io.Serializable;
import java.util.Date;

/**
 * Create Request or Response
 * abstract - weil kein message objekt erstellt werden darf, nur response oder reuqest
 * 
 * @author Fabian Siegrist
 * @author Oliver Freiermuth
 * @author Mikhail Onoufrienko
 * @author Risto Milani
 * @version $Revision: 81 $
 *          File name: $HeadURL: http://iching-kosmonauten.googlecode.com/svn/I-Ching/src/ch/fhnw/kosmonauten/net/Message.java $
 *          Last modified:$Date: 2013-05-24 12:44:57 +0000 (Fri, 24 May 2013) $
 *          Last modified by: $Author: molotok.mihon@gmail.com $
 */

// class definition
public abstract class Message implements Serializable {

	// attributes
	protected final String date;
	protected final Serializable content;
	protected final String type;

	// constructor
	/**
	 * @param content
	 * @param type
	 */
	public Message(Serializable content, String type) {
		this.date = new Date().toString();
		this.content = content;
		this.type = type;
	}

	// methods
	/**
	 * @return
	 */
	public Object getContent() {
		return this.content;
	}

	/**
	 * @return
	 */
	public String getType() {
		return this.type;
	}

}
